package com.lg.system.main.service.impl;

import com.lg.system.main.entity.Dict;
import com.lg.system.main.dao.DictDao;
import com.lg.system.main.service.DictService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import java.util.List;
import java.util.Date;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 字典表 服务实现类
 * </p>
 *
 * @author dl
 * @since 2018-04-02
 */
@Transactional
@Service
public class DictServiceImpl extends ServiceImpl<DictDao, Dict> implements DictService {

	
	public boolean save( Dict dict) {
		dict.setGmtCreate(new Date());
		return super.insert(dict);
	}

	@Override
	public boolean update(Dict dict) {
		dict.setGmtModified(new Date());
		return super.updateById(dict);
	}
	
	
	@Override
	public boolean deleteById(Long id) {
		return super.deleteById(id);
	}

	@Override
	public boolean deleteByIds(List<Long> ids) {
		if(null==ids||ids.isEmpty()){
			return false;
		}
		return super.deleteBatchIds(ids);
	}

}
